<%@ Page Language="C#" MasterPageFile="~/Employee.master" AutoEventWireup="true" CodeFile="ViewVPPPayment.aspx.cs" Inherits="Pages_Employee_ManageVPPPayment_ViewVPP" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Label ID="Label1" runat="server" CssClass="header" Text="View VPP Payments"></asp:Label><br />
    <br />
    <asp:Panel ID="Panel1" runat="server" Height="34px" Width="637px">
        Search Payments:
        <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>&nbsp;<asp:Button ID="btnSearch"
            runat="server" Text="Search" OnClick="btnSearch_Click" />
        <asp:RequiredFieldValidator ID="reqSearch" runat="server" ControlToValidate="txtSearch"
            ErrorMessage="Search text cannot be blank"></asp:RequiredFieldValidator>&nbsp;<br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp; &nbsp;&nbsp;
        <asp:RadioButton ID="rdDeliverableID" runat="server" Checked="True" GroupName="GroupSearch"
            Text="DeliverableID" />&nbsp;
        <asp:RadioButton ID="rdCustomerName" runat="server" GroupName="GroupSearch" Text="Customer Name" />
        <asp:CustomValidator ID="custSearch" runat="server" ControlToValidate="txtSearch"
            ErrorMessage="Invalid DeliverableID" OnServerValidate="custSearch_ServerValidate"></asp:CustomValidator></asp:Panel>
    <br />
    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
    <br />
    <br />
    <asp:GridView ID="gvVPPPayments" runat="server" AutoGenerateColumns="False" DataKeyNames="DeliverableID" DataSourceID="VPPObjectDataSource" HeaderStyle-CssClass="smallheader" HeaderStyle-BackColor="#a9c0f2" BorderColor="#556CB0" GridLines="Vertical" Width="560px" AllowPaging="True" OnPageIndexChanging="gvVPPPayments_PageIndexChanging">
        <Columns>
            <asp:BoundField DataField="DeliverableID" HeaderText="Deliverable ID" InsertVisible="False"
                ReadOnly="True" SortExpression="DeliverableID" />
            <asp:BoundField DataField="FullName" HeaderText="Customer" SortExpression="FullName" />
            <asp:BoundField DataField="AmountToCollect" HeaderText="Amount To Collect" SortExpression="AmountToCollect" />
            <asp:BoundField DataField="Charge" HeaderText="Charge" SortExpression="Charge" />
            <asp:CheckBoxField DataField="IsCustomerPaid" HeaderText="Is Paid" SortExpression="IsCustomerPaid" />
            <asp:HyperLinkField DataNavigateUrlFields="DeliverableID" DataNavigateUrlFormatString="~/Pages_Employee/ManageVPPPayment/EditVPPPayment.aspx?DeliverableID={0}"
                HeaderText="Edit" Text="Edit" />
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:CheckBox ID="cboDelete" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle HorizontalAlign="Center" BackColor="#A9C0F2" CssClass="smallheader" />
        <AlternatingRowStyle BackColor="Gainsboro" />
        <RowStyle HorizontalAlign="Center" />
    </asp:GridView>
    <br />
    <asp:Button ID="btnAddVPPPayment" runat="server" Text="Add New Payment" CausesValidation="False" OnClick="btnAddVPPPayment_Click" />
    <asp:Button ID="btnDeleteVPPPayment" runat="server" Text="Delete Selected Payments" CausesValidation="False" OnClick="btnDeleteVPPPayment_Click" OnClientClick='return confirm("Are you sure you want to delete selected VPP Payments?");' />
    <asp:ObjectDataSource ID="VPPObjectDataSource" runat="server" SelectMethod="GetAllVPPPayments"
        TypeName="DALVPPPayment"></asp:ObjectDataSource>
</asp:Content>

